package com.wm.homework03;

public class Divide extends Calculator{
    public Divide() {
    }

    public Divide(double fristNum, double secondNum) {
        super(fristNum, secondNum);
    }

    @Override
    public void calculate() {
        if (super.getSecondNum() != 0){
            double sum = super.getFristNum() / super.getSecondNum();
            System.out.println("两个数相除为:" + sum);
        }else {
            System.out.println("除数不能为零!");
        }
    }
}
